package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -03 -26
 * Time: 20:52
 */
public class BookList{
    private Book[] books;//储存数据
    private int size;//有效个数
    public BookList(){
        books=new Book[20];
        books[0]=new Book("西游记","吴承恩",19,"小说");
        books[1]=new Book("水浒传","施耐庵",29,"小说");
        books[2]=new Book("红楼梦","曹雪芹",29,"小说");
        books[3]=new Book("三国演义","罗贯中",19,"小说");
        size=4;
    }

    public Book getBooks(int pos) {
        return books[pos];
    }

    public void setBooks(int pos,Book book) {
        this.books[pos] = book;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getSize() {
        return size;
    }

}
